package com.yiqi.zhiyuan.feature.login.contract;

import com.suozhang.framework.entity.bo.LoginRequest;
import com.suozhang.framework.entity.bo.TokenInfo;
import com.suozhang.framework.entity.bo.UserAccount;
import com.suozhang.framework.entity.bo.UserInfoBo;
import com.suozhang.framework.framework.BasePresenter;
import com.suozhang.framework.framework.BaseView;
import com.yiqi.zhiyuan.entity.dto.RegisterDTO;

import io.reactivex.Observable;

/**
 * @ProjectName: ZhiYuan
 * @Description: java类作用描述
 * @Author: lijuwen
 * @CreateDate: 2019/3/13 12:21
 * @UpdateUser: 更新者
 * @UpdateDate: 2019/3/13 12:21
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
public interface RegisterContract {

    interface Model {
        /**
         * 发送验证码
         *
         * @param phone
         * @return
         */
        Observable<String> doSendCode(String phone,int type);

        /**
         * 注册
         *
         * @param registerDTO
         * @return
         */
        Observable<UserInfoBo> doRegister(RegisterDTO registerDTO);



    }

    interface View extends BaseView {

        /**
         * 验证码获取成功
         *
         * @param
         */
        void showGetCodeSuccess();

        /**
         * 验证码获取失败
         *
         * @param errorMsg
         */
        void showGetCodeError(String errorMsg);


        /**
         * 注册成功
         */
        void showRegisterSuccess(UserInfoBo userInfoBo);

        /**
         * 注册失败
         */
        void showRegisterError(String errorMsg);
    }

    interface Presenter extends BasePresenter {

        /**
         * 发送验证码
         *
         * @param mobile
         */
        void sendCode(String mobile);

        /**
         * @param mobile   手机号
         * @param password 密码
         * @param vcode    短信验证码
         */
        void register(String mobile, String password, String vcode);
    }
}
